home *** CD-ROM | disk | FTP | other *** search
/ Saar AMOK 2 / Saar AMOK II - Oktober 1994 (1994)(Kreativ Marketing)(DE)[!][I-7598].iso / tools / amigaguide / ag_v34 / include / libraries / amigaguide.h
C/C++ Source or Header  |  1992-12-29  |  7KB  |  247 lines

  1. #ifndef LIBRARIES_AMIGAGUIDE_H
  2. #define LIBRARIES_AMIGAGUIDE_H
  3. /* amigaguide.h
  4.  * structures needed for the amigaguide.library system
  5.  * written by David N. Junod
  6.  *
  7.  * $Id
  8.  *
  9.  * $Log
  10.  *
  11.  */
  12. #ifndef EXEC_TYPES_H
  13. #include <exec/types.h>
  14. #endif /* EXEC_TYPES_H */
  15.  
  16. #ifndef EXEC_LISTS_H
  17. #include <exec/lists.h>
  18. #endif /* EXEC_LISTS_H */
  19.  
  20. #ifndef EXEC_NODES_H
  21. #include <exec/nodes.h>
  22. #endif /* EXEC_NODES_H */
  23.  
  24. #ifndef EXEC_SEMAPHORES_H
  25. #include <exec/semaphores.h>
  26. #endif
  27.  
  28. #ifndef INTUITION_INTUITION_H
  29. #include <intuition/intuition.h>
  30. #endif
  31.  
  32. #ifndef INTUITION_SCREENS_H
  33. #include <intuition/screens.h>
  34. #endif
  35.  
  36. #ifndef LIBRARIES_DOS_H
  37. #include <libraries/dos.h>
  38. #endif
  39.  
  40. #ifndef UTILITY_TAGITEM_H
  41. #include <utility/tagitem.h>
  42. #endif
  43.  
  44. #ifndef MEMORY_FOLLOWING
  45. /* Usually allocate one large block of memory for a group of items and then
  46.  * divy out to the appropriate pointers.  Use with caution---must be
  47.  * consistent with field types! */
  48. #define MEMORY_FOLLOWING(ptr) ((void *)((ptr)+1))
  49. #define MEMORY_N_FOLLOWING(ptr,n)  ((void *)( ((ULONG)ptr) + n ))
  50. #endif
  51.  
  52. #ifndef V
  53. /* Used to cast an pointer to a void pointer */
  54. #define V(x) ((VOID *)x)
  55. #endif
  56.  
  57. #ifndef    ALTED
  58. #define    ALTED    (IEQUALIFIER_RALT | IEQUALIFIER_LALT)
  59. #endif
  60.  
  61. #ifndef SHIFTED
  62. #define    SHIFTED    (IEQUALIFIER_RSHIFT | IEQUALIFIER_LSHIFT)
  63. #endif
  64.  
  65. #ifndef APSH_TOOL_ID
  66. #define    APSH_TOOL_ID 11000L
  67. #define    StartupMsgID    (APSH_TOOL_ID+1L)    /* Startup message */
  68. #define    LoginToolID    (APSH_TOOL_ID+2L)    /* Login a tool SIPC port */
  69. #define    LogoutToolID    (APSH_TOOL_ID+3L)    /* Logout a tool SIPC port */
  70. #define    ShutdownMsgID    (APSH_TOOL_ID+4L)    /* Shutdown message */
  71. #define    ActivateToolID    (APSH_TOOL_ID+5L)    /* Activate tool */
  72. #define    DeactivateToolID (APSH_TOOL_ID+6L)    /* Deactivate tool */
  73. #define    ActiveToolID    (APSH_TOOL_ID+7L)    /* Tool Active */
  74. #define    InactiveToolID    (APSH_TOOL_ID+8L)    /* Tool Inactive */
  75. #define    ToolStatusID    (APSH_TOOL_ID+9L)    /* Status message */
  76. #define    ToolCmdID    (APSH_TOOL_ID+10L)    /* Tool command message */
  77. #define    ToolCmdReplyID    (APSH_TOOL_ID+11L)    /* Reply to tool command */
  78. #define    ShutdownToolID    (APSH_TOOL_ID+12L)    /* Shutdown tool */
  79. #endif
  80.  
  81. /* Attributes accepted by GetAmigaGuideAttr() */
  82. #define    AGA_Dummy    (TAG_USER)
  83. #define    AGA_Path    (AGA_Dummy + 1)
  84. #define    AGA_XRefList    (AGA_Dummy + 2)
  85. #define    AGA_Activate    (AGA_Dummy + 3)
  86.  
  87. #ifndef    AMIGAGUIDECONTEXT
  88. typedef void *AMIGAGUIDECONTEXT;
  89. #endif
  90.  
  91. struct AmigaGuideMsg
  92. {
  93.     struct Message agm_Msg;            /* Embedded Exec message structure */
  94.     ULONG agm_Type;                /* Type of message */
  95.     APTR agm_Data;                /* Pointer to message data */
  96.     ULONG agm_DSize;                /* Size of message data */
  97.     ULONG agm_DType;                /* Type of message data */
  98.     ULONG agm_Pri_Ret;                /* Primary return value */
  99.     ULONG agm_Sec_Ret;                /* Secondary return value */
  100.     APTR agm_System1;
  101.     APTR agm_System2;
  102. };
  103.  
  104. /* Allocation description structure */
  105. struct NewAmigaGuide
  106. {
  107.     BPTR nag_Lock;                /* Lock on the document directory */
  108.     STRPTR nag_Name;                /* Name of document file */
  109.     struct Screen *nag_Screen;            /* Screen to place windows within */
  110.     STRPTR nag_PubScreen;            /* Public screen name to open on */
  111.     STRPTR nag_HostPort;            /* Application's ARexx port name */
  112.     STRPTR nag_ClientPort;            /* Name to assign to the clients ARexx port */
  113.     STRPTR nag_BaseName;            /* Base name of the application */
  114.     ULONG nag_Flags;                /* Flags */
  115.     STRPTR *nag_Context;            /* NULL terminated context table */
  116.     STRPTR nag_Node;                /* Node to align on first (defaults to Main) */
  117.     LONG nag_Line;                /* Line to align on */
  118.     struct TagItem *nag_Extens;            /* Tag array extension */
  119.     VOID *nag_Client;                /* Private! MUST be NULL */
  120. };
  121.  
  122. /* public Client flags */
  123. #define    HTF_LOAD_INDEX    (1L<<0)            /* Force load the index at init time */
  124. #define    HTF_LOAD_ALL    (1L<<1)            /* Force load the entire database at init */
  125. #define    HTF_CACHE_NODE    (1L<<2)            /* Cache each node as visited */
  126. #define    HTF_CACHE_DB    (1L<<3)            /* Keep the buffers around until expunge */
  127. #define    HTF_UNIQUE    (1L<<15)        /* Unique ARexx port name */
  128. #define    HTF_NOACTIVATE    (1L<<16)        /* Don't activate window */
  129.  
  130. #define    HTFC_SYSGADS    0x80000000
  131.  
  132. /* Callback function ID's */
  133. #define    HTH_OPEN    0
  134. #define    HTH_CLOSE    1
  135.  
  136. #define    HTERR_NOT_ENOUGH_MEMORY        100L
  137. #define    HTERR_CANT_OPEN_DATABASE    101L
  138. #define    HTERR_CANT_FIND_NODE        102L
  139. #define    HTERR_CANT_OPEN_NODE        103L
  140. #define    HTERR_CANT_OPEN_WINDOW        104L
  141. #define    HTERR_INVALID_COMMAND        105L
  142. #define    HTERR_CANT_COMPLETE        106L
  143. #define    HTERR_PORT_CLOSED        107L
  144. #define    HTERR_CANT_CREATE_PORT        108L
  145. #define    HTERR_KEYWORD_NOT_FOUND        113L
  146.  
  147. #ifndef    AMIGAGUIDEHOST
  148. typedef struct AmigaGuideHost *AMIGAGUIDEHOST;
  149. #endif
  150.  
  151. /* Cross reference node */
  152. struct XRef
  153. {
  154.     struct Node xr_Node;    /* Embedded node */
  155.     UWORD xr_Pad;        /* Padding */
  156.     struct DocFile *xr_DF;    /* Document defined in */
  157.     STRPTR xr_File;        /* Name of document file */
  158.     STRPTR xr_Name;        /* Name of item */
  159.     LONG xr_Line;        /* Line defined at */
  160. };
  161.  
  162. #define    XRSIZE    (sizeof (struct XRef))
  163.  
  164. /* Types of cross reference nodes */
  165. #define    XR_GENERIC    0
  166. #define    XR_FUNCTION    1
  167. #define    XR_COMMAND    2
  168. #define    XR_INCLUDE    3
  169. #define    XR_MACRO    4
  170. #define    XR_STRUCT    5
  171. #define    XR_FIELD    6
  172. #define    XR_TYPEDEF    7
  173. #define    XR_DEFINE    8
  174.  
  175. /* Callback handle */
  176. struct AmigaGuideHost
  177. {
  178.     struct Hook agh_Dispatcher;        /* Dispatcher */
  179.     ULONG agh_Reserved;            /* Must be 0 */
  180.     ULONG agh_Flags;
  181.     ULONG agh_UseCnt;            /* Number of open nodes */
  182.     APTR agh_SystemData;            /* Reserved for system use */
  183.     APTR agh_UserData;            /* Anything you want... */
  184. };
  185.  
  186. /* Methods */
  187. #define    HM_FindNode    1
  188. #define    HM_OpenNode    2
  189. #define    HM_CloseNode    3
  190. #define    HM_Expunge    10        /* Expunge DataBase */
  191.  
  192. #ifndef Msg
  193. typedef struct
  194. {
  195.     ULONG MethodID;
  196. } *Msg;
  197. #endif
  198.  
  199. /* HM_FindNode */
  200. struct opFindHost
  201. {
  202.     ULONG MethodID;
  203.     struct TagItem *ofh_Attrs;        /*  R: Additional attributes */
  204.     STRPTR ofh_Node;            /*  R: Name of node */
  205.     STRPTR ofh_TOC;            /*  W: Table of Contents */
  206.     STRPTR ofh_Title;            /*  W: Title to give to the node */
  207.     STRPTR ofh_Next;            /*  W: Next node to browse to */
  208.     STRPTR ofh_Prev;            /*  W: Previous node to browse to */
  209. };
  210.  
  211. /* HM_OpenNode, HM_CloseNode */
  212. struct opNodeIO
  213. {
  214.     ULONG MethodID;
  215.     struct TagItem *onm_Attrs;        /*  R: Additional attributes */
  216.     STRPTR onm_Node;            /*  R: Node name and arguments */
  217.     STRPTR onm_FileName;        /*  W: File name buffer */
  218.     STRPTR onm_DocBuffer;        /*  W: Node buffer */
  219.     ULONG onm_BuffLen;            /*  W: Size of buffer */
  220.     ULONG onm_Flags;            /* RW: Control flags */
  221. };
  222.  
  223. /* onm_Flags */
  224. #define    HTNF_KEEP    (1L<<0)    /* Don't flush this node until database is
  225.                  * closed. */
  226. #define    HTNF_Reserved1    (1L<<1)    /* Reserved for system use */
  227. #define    HTNF_Reserved2    (1L<<2)    /* Reserved for system use */
  228. #define    HTNF_ASCII    (1L<<3)    /* Node is straight ASCII */
  229. #define    HTNF_Reserved3    (1L<<4)    /* Reserved for system use */
  230. #define    HTNF_CLEAN    (1L<<5)    /* Remove the node from the database */
  231. #define    HTNF_DONE    (1L<<6)    /* Done with node */
  232.  
  233. /* onm_Attrs */
  234. #define    HTNA_Screen    (TAG_USER + 1)    /* Screen that window resides in */
  235. #define    HTNA_Pens    (TAG_USER + 2)    /* Pen array (from DrawInfo) */
  236. #define    HTNA_Rectangle    (TAG_USER + 3)    /* Window box */
  237.  
  238.  
  239. /* HM_Expunge */
  240. struct opExpungeNode
  241. {
  242.     ULONG MethodID;
  243.     struct TagItem *oen_Attrs;        /*  R: Additional attributes */
  244. };
  245.  
  246. #endif /* LIBRARIES_AMIGAGUIDE_H */
  247.